<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>订单管理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no,address=no"/>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="../js/drop/dropload.css" />
    <link rel="stylesheet" href="../css/common.css"/>
    <link rel="stylesheet" href="../css/main.css"/>
    <style>
        .clickTap{
            border: 1px solid #ef8200;
            border-radius: .6rem;
            padding: 2px .2rem;
        }
    </style>
</head>
<body>
<section class="tabBar">
    <div class=" flex lh90 tac col9 bw tabs">
        <div class="flex1 active item" data-status="">全部</div>
        <div class="flex1 item" data-status="1">待发货</div>
        <div class="flex1 item" data-status="2">待收货</div>
        <div class="flex1 item" data-status="3">已完成</div>
    </div>
    <div class="h10 bgf5"></div>
</section>
<section class="pt100 container">
    <ul class="goods">
        <!--<li class="bw plr24 goods_item">-->
            <!--<a href="./supply_order_details.html" class="db">-->
                <!--<p class="flex_sb lh70 bdb">-->
                    <!--<span class="col9">订单编号:56565</span>-->
                    <!--<cite class="color2">待发货</cite>-->
                <!--</p>-->
                <!--<div class="ptb30 flex_a bdb">-->
                    <!--<div><img src="../img/test.png" class="goods_pic"></div>-->
                    <!--<div class="flex1 ml20">-->
                        <!--<p>清风纸巾</p>-->
                        <!--<p class="font12 col9">分类：日用品</p>-->
                        <!--<p class="flex_sb">-->
                            <!--<span class="color2">￥2.00</span>-->
                            <!--<cite class="col9">x1</cite>-->
                        <!--</p>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</a>-->
            <!--<div class="flex_sb ptb20">-->
                <!--<span class="col9">共1件商品 合计:<i class="color2">￥10.00</i></span>-->
                <!--<button class="color3 clickTap tap">发货</button>-->
            <!--</div>-->
        <!--</li>-->
        <!--<li class="bw plr24 goods_item">-->
            <!--<a class="db">-->
                <!--<p class="flex_sb lh70 bdb">-->
                    <!--<span class="col9">订单编号:56565</span>-->
                    <!--<cite class="color4">待发货</cite>-->
                <!--</p>-->
                <!--<div class="ptb30 flex_a bdb">-->
                    <!--<div><img src="../img/test.png" class="goods_pic"></div>-->
                    <!--<div class="flex1 ml20">-->
                        <!--<p>清风纸巾</p>-->
                        <!--<p class="font12 col9">分类：日用品</p>-->
                        <!--<p class="flex_sb">-->
                            <!--<span class="color2">￥2.00</span>-->
                            <!--<cite class="col9">x1</cite>-->
                        <!--</p>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</a>-->
            <!--<div class="flex_sb ptb20">-->
                <!--<span class="col9">共1件商品 合计:<i class="color2">￥10.00</i></span>-->
            <!--</div>-->
        <!--</li>-->
        <!--<li class="bw plr24 goods_item">-->
            <!--<a class="db">-->
                <!--<p class="flex_sb lh70 bdb">-->
                    <!--<span class="col9">订单编号:56565</span>-->
                    <!--<cite class="col9">已完成</cite>-->
                <!--</p>-->
                <!--<div class="ptb30 flex_a bdb">-->
                    <!--<div><img src="../img/test.png" class="goods_pic"></div>-->
                    <!--<div class="flex1 ml20">-->
                        <!--<p>清风纸巾</p>-->
                        <!--<p class="font12 col9">分类：日用品</p>-->
                        <!--<p class="flex_sb">-->
                            <!--<span class="color2">￥2.00</span>-->
                            <!--<cite class="col9">x1</cite>-->
                        <!--</p>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</a>-->
            <!--<div class="flex_sb ptb20">-->
                <!--<span class="col9">共1件商品 合计:<i class="color2">￥10.00</i></span>-->
            <!--</div>-->
        <!--</li>-->
    </ul>
</section>
</body>
</html>
<script src="../js/jquery-1.8.3.min.js"></script>
<script src="../js/dlc.js"></script>
<script type="text/javascript" src="../js/drop/dropload.min.js"></script>
<script>
    var status = '',jerry='';
    var page = 0;
    var limit = 10;
    var onOff = 0;
    $('.tabs').on('click','.item',function(){
        if(onOff == 1)return false;
        onOff = 1;
        $(this).addClass('active').siblings().removeClass('active');
        status = $(this).data('status');
        page = 1;
        jerry.unlock();
        $('.goods').html('');
        get_list();
    });
    function get_list(){
        var data = {'page':page,'limit':limit};
        if(status)data.status = status;
        dlc_request('/api/myOrder/MyOrderlList',data, function(res){
            console.log(res);
            if(res.code == 1){
                var res = res.data.list;
                var str = '';
                if(res.length>0){
                    for(var i in res){
                        str+='<li class="bw plr24 goods_item">'+
                                '<a href="./supply_order_details.html?orderNo='+res[i].orderNo+'" class="db">'+
                                '<p class="flex_sb lh70 bdb">'+
                                '<span class="col9">订单编号:'+res[i].orderNo+'</span>'+
                                '<cite class="'+(res[i].status==0?'color2':res[i].status==1?'color3':res[i].status==2?'color4':res[i].status==3?'col9':'')+'">'+(res[i].status==0?"待付款":res[i].status==1?"待发货":res[i].status==2?"待收货":res[i].status==3?"已完成":"未知状态")+'</cite>'+
                                '</p>';
                        for(var j in res[i].goodsMap){
                            str+='<div class="ptb30 flex_a bdb">'+
                                    '<div><img src="'+res[i].goodsMap[j].imgUrl+'" class="goods_pic"></div>'+
                                    '<div class="flex1 ml20">'+
                                    '<p>'+res[i].goodsMap[j].goodsName+'</p>'+
                                    '<p class="font12 col9">分类：'+res[i].goodsMap[j].cateName+'</p>'+
                                    '<p class="flex_sb">'+
                                    '<span class="color2">￥'+res[i].goodsMap[j].goodsPrice+'</span>'+
                                    '<cite class="col9">x'+res[i].goodsMap[j].goodsNum+'</cite>'+
                                    '</p>'+
                                    '</div>'+
                                    '</div>';
                        }
                        str+='</a>'+
                                '<div class="flex_sb ptb20">'+
                                '<span class="col9">共'+res[i].orderNum+'件商品 合计:<i class="color2">￥'+res[i].realPayment+'</i></span>';
                        if(res[i].status==1){
                            str+='<a href="./supply_order_details.html?orderNo='+res[i].orderNo+'" class="color3 clickTap tap">发货</a>';
                        }
                        str+='</div>'+
                                '</li>';
                    }
                }else{
                    jerry.lock();
                    jerry.noData();
                }

                setTimeout(function(){
                    if(page == 1){
                        $('.goods').html(str);
                    }else{
                        $('.goods').append(str);
                    }
                    onOff = 0;
                    jerry.resetload();
                    jerry.unlock();
                    jerry.noData(false);
                },1000);
            }else{
                dlctipbox.show(res.msg);
            }
        });
    };
    $('.container').dropload({
        scrollArea : window,
        domUp : {
            domClass   : 'dropload-up',
            domRefresh : '<div class="dropload-refresh">↓下拉刷新</div>',
            domUpdate  : '<div class="dropload-update">↑释放更新</div>',
            domLoad    : '<div class="dropload-load"><span class="loadings"></span>加载中...</div>'
        },
        domDown : {
            domClass   : 'dropload-down',
            domRefresh : '<div class="dropload-refresh">↑上拉加载更多</div>',
            domLoad    : '<div class="dropload-load"><span class="loadings"></span>加载中...</div>',
            domNoData  : '<div class="dropload-noData">暂无更多数据</div>'
        },
        loadUpFn : function(me){
            jerry = me;
            page = 1;
            get_list();
        },
        loadDownFn : function(me){
            jerry = me;
            page++;
            get_list();
        },
        threshold : 50
    });
</script>






















